/*
 * @Description: 
 * @Version: 2.0
 * @Autor: 张磊
 * @Date: 2020-11-11 09:27:40
 * @LastEditors: 张磊
 * @LastEditTime: 2020-11-16 09:34:41
 * @FilePath: \lht1802A\项目代码\rank_tree\src\router\index.js
 */
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/index/home'
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index'),
    children: [
      {
        path: '/index/home',
        name: 'Home',
        component: () => import('../views/Index/Home'),
      },
      {
        path: '/index/classify',
        name: 'Classify',
        component: () => import('../views/Index/Classify')
      },
      {
        path: '/index/message',
        name: 'Message',
        component: () => import('../views/Index/Message')
      },
      {
        path: '/index/my',
        name: 'My',
        component: () => import('../views/Index/My')
      },
    ]
  },

  {
    path: '/detail/:id',
    name: 'Detail',
    component: () => import('../views/Detail/index.vue')
  },
  {
    path: '/MyDetail',
    name: 'MyDetail',
    component: () => import('../views/Detail/MyDetail')
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Detail/Search')
  },
  {
    path: '/vdetail/:url',
    name: 'VDetail',
    component: () => import('../views/Detail/video.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
